<template>
  <div id="app">
    <nav>
      <!-- <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link> -->
      <router-link to="/">ProductList</router-link> |
      <router-link to="/shoppingCart">ShoppingCart</router-link> | 
      <router-link to="/login">
      <span v-show="isLogin">Logout</span>
      <span v-show="!isLogin">Login</span>
      </router-link>
    </nav>
    <h1>Shopping Cart Example</h1>
    <hr>
    <router-view />
  </div>
</template>

<script>
import ProductList from '@/views/ProductList.vue'
import ShoppingCart from '@/views/ShoppingCart.vue'
import { mapGetters } from 'vuex'

export default {
  components: { ProductList, ShoppingCart },
  computed: {
    ...mapGetters('user', {
        isLogin: 'isLogin'
      })
  },
  methods: {
  },
  created() {
  }
}
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
